package org.finesys.chat.core.base.embedding.filter;

import org.finesys.chat.core.base.embedding.filter.logical.AndFilter;
import org.finesys.chat.core.base.embedding.filter.logical.NotFilter;
import org.finesys.chat.core.base.embedding.filter.logical.OrFilter;

public interface Filter {

    boolean test(Object object);

    default Filter and(Filter filter) {
        return and(this, filter);
    }

    default Filter and(Filter left, Filter right) {
        return new AndFilter(left, right);
    }

    default Filter or(Filter filter) {
        return or(this, filter);
    }

    default Filter or(Filter left, Filter right) {
        return new OrFilter(left, right);
    }

    default Filter not(Filter filter) {
        return new NotFilter(filter);
    }
}
